package com.offcn.user.controller;

import com.offcn.bean.DataBean;
import com.offcn.data.service.DataService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;
import javax.annotation.Resource;
@Controller
@RequestMapping("data")
public class DataController {

    @Resource
    private DataService dataService;

    @RequestMapping("show-data")
    public String showData(Model model){
        DataBean data = dataService.queryData();
        model.addAttribute("data",data);
        return "/WEB-INF/jsp/main/data.jsp";
    }
}
